clear all;
clc;

load mnist_test;

l = 5000;
n = size(yU,2);
Y = yU(1:l)';
label = yU(l+1:n)';
Xtr = xU(:,1:l)';
Xts = xU(:,l+1:n)';
tic
[IDX,~] = knnsearch(Xtr,Xts,'K',7);
toc
Yp = int8(mode(yU(IDX)'))';

calacc(Yp,label)